package com.sywl.service.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sywl.dao.SupplierDao;
import com.sywl.orm.Supplier;
import com.sywl.service.SupplierService;
import com.sywl.util.DataGridModel;

@Service
public class SupplierServiceImpl implements SupplierService {

	@Autowired
	private SupplierDao supplierDao;
	
	@Transactional
	public void addSupplier(Supplier supplier) {
		supplierDao.addSupplier(supplier);
	}

	@Transactional
	public Map<String, Object> getPageList(DataGridModel dgm, Supplier supplier)
			throws Exception {
		return supplierDao.getPageList(dgm, supplier);
	}

	@Transactional
	public Supplier findById(Integer supplierId) {
		return supplierDao.findById(supplierId);
	}

	@Transactional
	public void delSupplier(Integer supplierId) {
		supplierDao.delSupplier(supplierId);
	}

	@Transactional
	public void updateSupplier(Supplier supplier) {
		supplierDao.updateSupplier(supplier);
	}

}
